home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
SourceCode
/
AdobeExamples
/
NX_ImportAdv
/
DrawingViewWraps.psw
< prev
next >
Wrap
Text File
|
1992-12-19
|
4KB
|
158 lines
/*
* (a) (C) 1990 by Adobe Systems Incorporated. All rights reserved.
*
* (b) If this Sample Code is distributed as part of the Display PostScript
* System Software Development Kit from Adobe Systems Incorporated,
* then this copy is designated as Development Software and its use is
* subject to the terms of the License Agreement attached to such Kit.
*
* (c) If this Sample Code is distributed independently, then the following
* terms apply:
*
* (d) This file may be freely copied and redistributed as long as:
* 1) Parts (a), (d), (e) and (f) continue to be included in the file,
* 2) If the file has been modified in any way, a notice of such
* modification is conspicuously indicated.
*
* (e) PostScript, Display PostScript, and Adobe are registered trademarks of
* Adobe Systems Incorporated.
*
* (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
* CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
* AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
* ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
* OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
* WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
* WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
* DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS.
*/
/*
* DrawingViewWraps.psw
*/
defineps PSWStrokeX(float LLX, LLY, URX, URY)
LLX LLY moveto URX URY lineto
LLX URY moveto URX LLY lineto stroke
endps
defineps PSWTranslateRotate(float X, Y, Angle)
X Y translate Angle rotate
endps
defineps PSWSetLine (float Width, Gray)
Width setlinewidth Gray setgray
endps
defineps PSWSetControlPoints (char *Font; float FontSize, FontGray, FontWidth)
/Font FontSize selectfont FontGray setgray FontWidth setlinewidth
endps
defineps PSWDrawControlPoints (float X, Y; float Pts[Tot_Pts]; int Tot_Pts; char *Chs)
X Y moveto (Chs) Pts xyshow
endps
/*
* The sa and rsa procedures ensure that the first character is drawn correctly
* with respect to device space. It's not so much an issue with square
* images but can be quite significant with other shapes.
*/
defineps PSWDefineFont(char *fontname)
10 dict dup begin
/sa { % x y sa x' y'
transform
0.25 sub round 0.25 add exch
0.25 sub round 0.25 add exch
itransform
} bind def
/rsa { %dx dy rsa dx' dy'
dtransform
round exch
round exch
idtransform
} bind def
/FontName /fontname def
/FontType 3 def
/FontMatrix [.001 0 0 .001 0 0] def
/FontBBox [-500 -500 500 500] def
/Encoding 256 array def
0 1 255 {Encoding exch /.notdef put} for
Encoding
dup (a) 0 get /Rectfill put
dup (b) 0 get /Rectopen put
dup (c) 0 get /CrossOut put
(d) 0 get /CrossIn put
/CharProcs 5 dict def
CharProcs begin
/.notdef { } def
/Rectfill
{
-300 -300 sa moveto 0 600 rsa rlineto
600 0 rsa rlineto 0 -600 rsa rlineto closepath
fill
} def
/Rectopen
{
-300 -300 sa moveto 0 600 rsa rlineto
600 0 rsa rlineto 0 -600 rsa rlineto closepath
stroke
} def
/CrossOut
{
100 600 sa moveto 0 -1200 rsa rlineto
-200 0 rsa rlineto 0 1200 rsa rlineto closepath
600 100 sa moveto 0 -200 rsa rlineto
-1200 0 rsa rlineto 0 200 rsa rlineto closepath
fill
} def
/CrossIn
{
0 500 sa moveto 0 -1000 rsa rlineto
-500 0 sa moveto 1000 0 rsa rlineto
stroke
} def
end
/BuildChar
{
500 0 -500 -500 500 500 setcachedevice
exch begin
Encoding exch get
CharProcs exch get
exec
end
} def
end
/fontname exch definefont pop
endps
/*
* Define the image dictionary. Base it off of the NeXTLaser-300
* dictionary only give it a different transfer function.
*/
defineps PSWDefineImageDict(char *dictname)
7 dict dup begin
/jobTag 0 def
/colorSpace 0 def
/defaultHalftone nextdict /NeXTMegaPixelDisplay get /defaultHalftone get def
/samplesPerPixel 1 def
/bitsPerSample 1 def
/initialTransfer {} def
/isPlanar false def
end
/dictname exch readonly def
endps